@(elements: helper.FieldElements)

@**************************************************
* Generate input according twitter bootsrap rules *
* Play has a built in template as well: 		  		*
*  helper.twitterBootstrap 						  					*	
**************************************************@

<div class="form-group @if(elements.hasErrors) {has-error}">
	<label for="@elements.id" class="col-md-2 control-label">@elements.label</label>
	<div class="@elements.args.toMap.get('inputDivClass).getOrElse("col-md-5")">
		@if(elements.input.toString().contains("class=")) {
			@Html(elements.input.toString().replaceFirst("(class=[\"'])", "$1form-control "))
		} else {
			@Html(elements.input.toString().replaceFirst("(<\\w+ )", "$1class=\"form-control\" "))
		}
		<span class="help-block text-muted">@elements.infos.mkString(", ")</span>
	  	@if(elements.hasErrors) {
    		<span class="help-block">@elements.errors.mkString(", ")</span>
		}
   </div>
</div>
